import java.io.*;

public class Scanner {
    private BufferedReader bf;
    private StreamTokenizer st;

    public Scanner(InputStream inputStream) {
        bf = new BufferedReader(new InputStreamReader(inputStream));
        st = new StreamTokenizer(bf);
    }

    public int nextInt() throws IOException {
        st.nextToken();
        return (int) st.nval;
    }

    public String nextLine() throws IOException {
        return bf.readLine();
    }
}
